Skip to content

Commit

Permalink
Don't care if your package has tests or not
Browse files Browse the repository at this point in the history
  • Loading branch information
regebro committed Oct 22, 2016
1 parent a8eb3d3 commit 4199479
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 30 deletions.
3 changes: 2 additions & 1 deletion HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
2.1.1 (unreleased)
------------------

- Nothing changed yet.
- Removed the TestSuite rating. I decided it was too close to looking at
code quality. Pyroma no longer cares if you have tests or not.


2.1 (2016-10-18)
Expand Down
24 changes: 1 addition & 23 deletions pyroma/ratings.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,27 +265,6 @@ def message(self):
"it defaults to True, which you probably do not want."


class TestSuite(BaseTest):

def test(self, data):
if data.get('_setuptools'):
self.weight = 50
if 'test_suite' in data:
return True
if 'cmdclass' in data:
if 'test' in data.get('cmdclass', []):
return True
return False
else:
self.weight = 0
return True

def message(self):
return "Setuptools and Distribute support running tests. By "\
"specifying a test suite, it's easy to find and run tests "\
"both for automated tools and humans."


class SDist(BaseTest):
weight = 100

Expand Down Expand Up @@ -370,7 +349,6 @@ def message(self):
Url(),
License(),
ZipSafe(),
TestSuite(),
SDist(),
PackageDocs(),
ValidREST(),
Expand Down Expand Up @@ -399,7 +377,7 @@ def rate(data):
good += test.weight
# If res is None, it's ignored.
if fatality:
# A fatal tests failed. That means we give a 0 rating:
# A fatal test failed. That means we give a 0 rating:
return 0, fails
# Multiply good by 9, and add 1 to get a rating between
# 1: All non-fatal tests failed.
Expand Down
6 changes: 0 additions & 6 deletions pyroma/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ def test_minimal(self):
"You are using Setuptools or Distribute but do not specify if "
"this package is zip_safe or not. You should specify it, as it "
"defaults to True, which you probably do not want.",
"Setuptools and Distribute support running tests. By specifying a "
"test suite, it's easy to find and run tests both for automated "
"tools and humans.",
]))

def test_lacking(self):
Expand All @@ -184,9 +181,6 @@ def test_lacking(self):
"You are using Setuptools or Distribute but do not specify if "
"this package is zip_safe or not. You should specify it, as it "
"defaults to True, which you probably do not want.",
"Setuptools and Distribute support running tests. By specifying a "
"test suite, it's easy to find and run tests both for automated "
"tools and humans.",
]))

def test_custom_test(self):
Expand Down

0 comments on commit 4199479

Please sign in to comment.